package com.etoak.controller;


import com.etoak.bean.*;
import com.etoak.service.HomestayService;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/homestayClient")
public class HomestayClientController {

    @Resource
    private HomestayService service;


    @GetMapping("/selectHomestay")
    public ResultVo selectHomestay(Page page,HomestayVO homestay){
        return  ResultVo.success().setData(service.selectHomestay(page,homestay));
    }

    @GetMapping("/queryHomestayByHid")
    public ResultVo queryHomestayByHid(HomestayVO homestay){
        return  ResultVo.success().setData(service.queryHomestayByHid(homestay));
    }

    @GetMapping("selectDictByName")
    public ResultVo selectDictByName(String name,Integer level){
        return  ResultVo.success().setData(service.selectDictByName(name,level));
    }

    @GetMapping("/queryHomestayByKeyWords")
    public ResultVo queryHomestayByKeyWords(String keyword, String destination) {
        return ResultVo.success().setData(service.queryHomestayByKeyWords(keyword,destination));
    }
}
